﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace QLXuongCNTT.DataLayers
{
    class dtlGiaovien
    {
        ConnectDB conn;
        string error;
        DataTable tb;
        SqlCommand cmd;
        public string Error
        {
            get { return error; }
            set { error = value; }
        }
        public dtlGiaovien()
        {
            conn = new ConnectDB();
            error = "";
        }
        public DataTable GetGiaovien()
        {
            string sql = "select * from Giaovien" ;
            cmd = new SqlCommand();
            cmd.CommandText = sql;
            conn.GetData(cmd);
            if (!conn.Error.Equals(""))
                error = conn.Error;
            return conn;
        }
        public DataRow NewRow()
        {
            return conn.NewRow();
        }
        public void Addrow(DataRow row)
        {
            conn.Rows.Add(row);
        }
        public bool Save()
        {
            return (conn.Executive() > 0);
        } 
    }
}
